package thread;

public class SleepDemo2 {
    public static void main(String[] args) {
        Thread qwe= new Thread("张三"){
            public void run (){
                System.out.println("张三开始睡觉了");
                try {
                    Thread.sleep(1000000000);
                } catch (InterruptedException e) {
                    System.out.println("是谁?,是谁啊?");
                }
                System.out.println("张三醒了");
            }
        };
        Thread asd= new Thread("李四"){
            public void run(){
                System.out.println(getName()+"你今天去的哪里吃饭");
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("你去问问张三吧,他带我去的");

                qwe.interrupt();
            }
        };
        qwe.start();
        asd.start();

    }
}
